package com.qinggeng.project.system.service;

import com.qinggeng.project.system.domain.OrdersGift;
import com.qinggeng.project.system.domain.OrdersGoods;
import com.qinggeng.project.system.domain.OrdersPoint;
import com.qinggeng.project.system.domain.SinglePointSale;
import com.qinggeng.project.system.domain.vo.SinglePointSaleVo;

import java.util.Date;
import java.util.List;

/**
 * @author 吴鹏飞
 * @date 2020/11/17
 * 配送区域单配送点销量业务
 */
public interface SinglePointSaleService {
    /**
     * 查询配送区域单个自提点销量
     *
     * @param id 配送区域单个自提点销量ID
     * @return 配送区域单个自提点销量
     */
    public SinglePointSale getSinglePointSaleById(Long id);

    /**
     * 根据配送点Id、商品ID和记录日期查询销量
     * @return
     */
    SinglePointSale getSinglePointSaleByPointIdAndGoodsIdAndRecordDate(Long pointId, Long goodsId, String recordDate);

    SinglePointSale getSinglePointSaleByPointIdAndGiftIdAndRecordDate(Long pointId, Long giftId, String recordDate);

    /**
     * 增加销量
     * @param id
     * @param saleNum
     * @return
     */
    boolean addSinglePointSaleNum(Long id,Integer saleNum);

    /**
     * 减去销量
     * @param id
     * @param saleNum
     * @return
     */
    boolean subtractSinglePointSaleNum(Long id,Integer saleNum);

    /**
     * 查询配送区域单个自提点销量列表
     *
     * @param singlePointSale 配送区域单个自提点销量
     * @return 配送区域单个自提点销量集合
     */
    public List<SinglePointSale> listSinglePointSale(SinglePointSale singlePointSale);

    /**
     * 新增配送区域单个自提点销量
     *
     * @param singlePointSale 配送区域单个自提点销量
     * @return 结果
     */
    boolean insertSinglePointSale(SinglePointSale singlePointSale);

    /**
     * 修改配送区域单个自提点销量
     *
     * @param singlePointSale 配送区域单个自提点销量
     * @return 结果
     */
    public int updateSinglePointSale(SinglePointSale singlePointSale);

    void updateSinglePointSale(OrdersPoint ordersPoint, OrdersGoods ordersGoods, String recordDate);


    void updateSinglePointSale(OrdersPoint ordersPoint, OrdersGift ordersGift, String recordDate);


    /**
     * 删除配送区域单个自提点销量
     *
     * @param id 配送区域单个自提点销量ID
     * @return 结果
     */
    public int deleteSinglePointSaleById(Long id);

    /**
     * 批量删除配送区域单个自提点销量
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteSinglePointSaleByIds(Long[] ids);


    /**
     * 查询配送区域单配送点销量集合
     * @param singlePointSale
     * @return
     */
    List<SinglePointSale> selectSinglePointSaleList(SinglePointSale singlePointSale);

    List<SinglePointSale> listSinglePointSaleByTime(SinglePointSale where);
    /**
     * 获取配送区域单配送点销量详细信息
     * @param id
     * @return
     */
    SinglePointSale selectSinglePointById(Long id);

    /**
     * 批量添加数据
     * @param singlePointSaleList
     */
    void insertSinglePointSaleList(List<SinglePointSale> singlePointSaleList);

    /**
     * 查询昨天的单自提点销量
     * @return
     */
    List<SinglePointSaleVo> listSinglePointSaleByYesterday(Long pointId,String  recordDate);

    /**
     * 打印自提点销量
     * @param id
     * @return
     */
    boolean printSinglePointSaleList(Long id);


    /**
     * 打印自提点销量
     * @param ids
     * @return
     */
    boolean printSinglePointByIds(String ids);

}
